package com.cy;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Objects;

/**
 * @author : yue.cao
 * @since : 2021-04-15
 */
@Setter
@Getter
@ToString
@AllArgsConstructor
public class User {
	private Integer userId;
	private String name;


	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		User user = (User) o;
		return Objects.equals(userId, user.userId) &&
				Objects.equals(name, user.name);
	}

	@Override
	public int hashCode() {
		return Objects.hash(userId, name);
	}
}
